﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Liolikas.GameBoard;

namespace Liolikas.GameBoard
{
    class Board
    {
         static public int BOARD_HEIGHT=30;
         static public int BOARD_WIDTH = 64;

         static Board board;
         static Field[,] fields = new Field[BOARD_HEIGHT, BOARD_WIDTH];

         Board()
         {
             TerrainFactory terrainFactory = TerrainFactory.GetTerrainFactory();
             for (int i = 0; i < BOARD_WIDTH; i++)
                 for (int j = 0; j < BOARD_HEIGHT; j++)
                     fields[j, i] = new Field(null);
         }

         public static Board GetBoard()
         {
             if (board == null) board = new Board();
             return board;
         }
         
         public Field GetField(int row, int column)
         {
             return fields[row,column];
         }

         public void InitBoard()
         {
             Console.SetWindowSize( Board.BOARD_WIDTH + 2, BOARD_HEIGHT + 3);
             Console.SetWindowPosition(0, 0);
             Console.Title = "Liolikas";
             Console.CursorVisible = false;
         }

    }
}
